﻿using System;
using System.Buffers;
using Beefly.Json.Extensions;
using Beefly.Json.Meta;

namespace Beefly.Json.Formats;

sealed class UInt128JsonFormat : AJsonFormat<UInt128>
{
    public override void Serialize(IBufferWriter<char> writer, ref UInt128 item)
    {
        writer.WriteNumberChar(ref item);
    }

    public override UInt128 Deserialize(in Span<char> str)
    {
        return UInt128.Parse(str);
    }
}